<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 300px;
        }
    </style>
</head>
<body>
    <div>123</div>
    <div class="box"></div>
    <p id="nav">导航栏</p>
    <ul>
        <li>测试1</li>
        <li>测试2</li>
        <li>测试3</li>
    </ul>
</body>

<script>
    const div=document.querySelector("div");
    console.dir(div);
    const box=document.querySelector(".box");
    console.log(box);
    const nav= document.getElementById("#nav");
    console.log(nav);
    const li = document.querySelector("ul li:first-child");
    console.log(li);
</script>
</html>